/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package maumau;

import java.util.*;

public class MauMau_ThePlayer extends MauMau_Intf {
        private Random rand;
        
    MauMau_ThePlayer() {
    rand = new Random(0);
    };
    
    int c_topCard;
    Vector<Integer> c_actions;

//    @Override
//    public boolean equals(Object obj) {
//        if (obj == null) {
//            return false;
//        }
//        if (getClass() != obj.getClass()) {
//            return false;
//        }
//        final MauMau_ThePlayer other = (MauMau_ThePlayer) obj;
//        if (this.c_topCard != other.c_topCard) {
//            return false;
//        }
//        if (this.c_actions != other.c_actions && (this.c_actions == null || !this.c_actions.equals(other.c_actions))) {
//            return false;
//        }
//        return true;
//    }

    public int hashCode(int topCard, Vector<Integer> actions) {
        int hash = 5;
        hash = 29 * hash + topCard;
        hash = 29 * hash + (actions != null ? actions.hashCode() : 0);
        return hash;
    }
    
    
    
    
    
    
    // Overwrite methods you want to use
    public void newGame() {
        System.out.println(getName() + ": newGame called");
    };
    
//#########################	
    
//tmp data        
    
    
//#########################    
    
	@Override
	public int step(MauMau_State state, Vector<Integer> actions, double reward,
			boolean terminal) {
		System.out.println(getName() + ": step-method called.   reward = " + reward + "    terminal = " + terminal);
		// Terminal state? No action has to be selected. Perform RL-updates (e.g. for Monte Carlo)
            if(terminal) {
                System.out.println(getName() + ": I am called because game has ended");
                return 0;
            }

            hashCode(state.getOpenCard)
//#########################	
            
        int c_topCard = state.getOpenCard();
        Vector<Integer> c_actions = new Vector<Integer>(actions);
        
        
        
        
        
        
//        tmp_data tmp = new tmp_data(state.getOpenCard(), actions);
        
        
       
        
        
        
        
        
            
//#########################	
            // Select random action
        int pos = rand.nextInt(actions.size());
        Integer i = actions.get(pos);
        return i.intValue();
	}
    
        

//private class tmp_data{
//    
//    tmp_data(int topCard, Vector<Integer> actions){
//        this.c_topCard = topCard;
//        this.c_actions = actions;
//    };
//    
//    private int c_topCard;
//    private Vector<Integer> c_actions = new Vector<Integer>();
//    private double[][][] aqk;
//    
//}
}
